﻿@model Peninsula.Web.Areas.Backstage.Models.RepairOrder.RepairOrderCreateOrEditModel

@section Scripts{
    @*这里写页面自定义脚本*@
    <script>

        $(document).ready(function () {
            $('#Status').change(function () {
                if ($('#Status').find('option:selected').text() == '维修完') {
                    $('#Price').attr('disabled', false);
                } else {
                    $('#Price').attr('disabled', true);
                }
                if ($('#Status').find('option:selected').text() == '户主外出') {
                    $('#MMessage').attr('disabled', false);
                } else {
                    $('#MMessage').attr('disabled', true);
                }
            })
            
        });
        //$(function () {
        //    $('#Status').change(function () {
        //        if ($('#Status').find('option:selected').text()== '维修完') {
                  
        //            $('#Price').attr('disabled',false);
        //        } else {
        //            $('#Price').attr('disabled',true);
        //        }
        //    });
            
        //});

        //function () {
        //    var Price = document.getElementById("Price");
        //    if (document.getElementById("Status").value != "维修完") {
        //        obj.disabled = false;
        //    } else {
        //        obj.disabled = true;
        //    }
        //}
    </script>
}


<!-- BEGIN FORM PORTLET -->
<div class="portlet">
    <div class="portlet-title">
        <div class="caption">
            <i class="fa fa-reorder"></i>更改状态
        </div>
    </div>
    <div class="portlet-body form">

        @using (Html.BeginForm("ChangeOrderStatus", "MaintenanceStaff", FormMethod.Post,
                new { @class = "form-horizontal js-form js-ajax-form", enctype = "multipart/form-data", id = "fileupload" }))
        {
            @Html.AntiForgeryToken()
            @Html.HiddenFor(m => m.Id)
            <div class="form-body">
               
                <div class="form-group">
                    <label class="col-md-3 control-label">
                        @Html.DisplayNameFor(m => m.Status)
                    </label>
                    <div class="col-md-4">
                        @Html.DropDownListFor(t => t.Status, SelectListItemsHelper.FromEnum(typeof(ChangStatus), extraFirstItem: "请选择"), new { @class = "form-control" })
                    @Html.ValidationMessageFor(m => m.Status)
                    </div>
                </div> 
                <div class="form-group">
                    <label class="col-md-3 control-label">
                        @Html.DisplayNameFor(m => m.Price)
                    </label>
                    <div class="col-md-4">
                      @Html.TextBoxFor(m=>m.Price, new { @class = "form-control" ,@disabled=true})
                        @Html.ValidationMessageFor(m => m.Price )
                    </div>
                </div> 
                <div class="form-group">
                    <label class="col-md-3 control-label">
                        @Html.DisplayNameFor(m => m.MMessage)
                    </label>
                    <div class="col-md-4">
                        @Html.TextAreaFor(m => m.MMessage, new { @class = "form-control", @disabled = true })
                        @Html.ValidationMessageFor(m => m.MMessage)
                    </div>
                </div> 
            <div class="form-actions fluid">
                <div class="col-md-offset-3 col-md-9">
                    <button type="submit" class="btn btn-success">更改</button>
                    <a href="@HttpContext.Current.Request.UrlReferrer" class="btn btn-default">取消</a>
                </div>
            </div>
         </div>
        }

    </div>
</div>